﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Star : MonoBehaviour
{
    public GameObject starIcon;
    // Start is called before the first frame update
    void Start()
    {
        
    }

    // Update is called once per frame
    void Update()
    {
        
    }

    public void Init(bool showStar)
    {
        starIcon.gameObject.SetActive(showStar);

        if (showStar)
        {
            var ps = GetComponentInChildren<ParticleSystem>();
            if (ps)
            {
                DoActionDelay.DelayAction(.2f, () =>
                {
                    ps.Play();
                });
            }
        }
    }
}
